//
//  BKWidigitSignalView.m
//  bestkeep
//
//  Created by windCould on 17/1/11.
//  Copyright © 2017年 utouu. All rights reserved.
//

#import "BKWidigitSignalView.h"

#define iPhone6P ([[UIScreen mainScreen] bounds].size.width >= 370.0f ? YES : NO)

@interface BKWidigitSignalView ()

@end

@implementation BKWidigitSignalView

- (UIImageView *)iconImageView {
    
    if (!_iconImageView) {
        _iconImageView = [[UIImageView alloc] init];
        [self addSubview:_iconImageView];
    }
    return _iconImageView;
}
- (UILabel *)nameLabel {
    
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc] init];
        [self addSubview:_nameLabel];
    }
    return _nameLabel;
}



- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        
        if (iPhone6P && [[UIDevice currentDevice].systemVersion doubleValue] >= 10.0) {
            self.iconImageView.bounds = CGRectMake(0, 0, 45, 45);
            self.iconImageView.center = CGPointMake(self.bounds.size.width/2.0f, 37);
        }else {
            self.iconImageView.bounds = CGRectMake(0, 0, 40, 40);
            self.iconImageView.center = CGPointMake(self.bounds.size.width/2.0f, 38);
        }
        
        
        [self.nameLabel setTextAlignment:NSTextAlignmentCenter];
        self.nameLabel.font = [UIFont systemFontOfSize:12];
        self.nameLabel.frame = CGRectMake(0, 70.0f, self.bounds.size.width, 12);
        if ([[UIDevice currentDevice].systemVersion doubleValue] < 10.0) {
            self.nameLabel.textColor = [UIColor whiteColor];
        }
    }
    return self;
}


@end
